package com.youbug;

import com.youbug.common.config.ModuleName;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.List;
import java.util.TimeZone;

@SpringBootApplication
@EnableScheduling
public class Application {

	public static List<String> moduleNameList = new ArrayList<>();

	@Autowired
	private List<ModuleName> moduleNames;

	@PostConstruct
	public void init() throws BeansException {
		moduleNames.forEach(e->{
			moduleNameList.add(e.getModuleName());
		});
	}

	public static void main(String[] args) {
		TimeZone timeZone = TimeZone.getTimeZone("UTC+8");
		TimeZone.setDefault(timeZone);
		SpringApplication.run(Application.class, args);
	}
}
